import {createI18n} from 'vue-i18n'
import zhCn from './zh-cn.js'
import en from './en.js'

const language = localStorage.getItem('language') || 'cn'
const i18n = createI18n({
  locale: language,
  legacy: false,
  globalInjection: true,
  messages: {
    cn: {
      ...zhCn
    },
    en: {
      ...en
    },
  },
})

export default i18n
